hysop.iterative_method module¶
Description of an iterative method (iteration, stopping criteria, …)
- class hysop.iterative_method.IterativeMethod(stop_criteria, tolerance=1e-08, state_print=100, max_iter=10000, dt0=None, dt=None, configsimu=None, **kwargs)[source]¶
Bases:
Problem
Overriding a Problem to enfoce a PseudoSimulation for iterative method loop.
The PseudoSimulation is created on each ‘apply’. There is no meaning for the underlying pseudo-time.
Notes
Sub-timestepping is not a usual use-case for this Problem. One should override Problem class in a proper way. Here only a pseudo-timestep is used together with a maximal number of iteration to compute a pseudo-final time.
- Parameters:
kwds (arguments for base classes.)
Notes
- The following base class variables cannot be specified during graph construction:
variables, input_variables, output_variables
- Order of operation is: add_node, initialize, discretize,
get_work_properties, setup, apply, finalize.
Nodes can also be added during pre initialization step. Graph building is done at the end of the initialization step, after all internal nodes have been initialized.
- class hysop.iterative_method.PseudoSimulation(stop_criteria, tolerance=1e-08, **kwds)[source]¶
Bases:
Simulation
Pseudo time-iterations for iterative method
- Parameters:
stop_criteria (TensorParameter) – Iterative loop test for stopping is stop_criteria<tolerance
tolerance (float (optional)) – Tolerance for stopping criteria (default to 1e-8)
Notes
This object implement an iterative method in a pseudo-time inside a ‘real’ time interval. It can be used as sub-iterations for a fixed-point operator. It implements a loop defined as follows:
while(t<end and iteration<max_iter and max(stop_criteria)>tolerance)